#include <iostream>
using namespace std;

typedef long long LL;
LL T;
LL n, a, b;
LL fun()
{
    if (n <= 2) return min(a, b);
    LL ret = 0;
    if (3 * a < 2 * b)
    {
        ret += n / 2 * a;
        n %= 2;
        if (n) ret += min(min(a, b), b - a);
    }
    else
    {
        ret += n / 3 * b;
        n %= 3;
        if (n == 1) ret += min(min(a, b), 2 * a - b);
        if (n == 2) ret += min(min(a, b), 3 * a - b);
    }
    return ret;
}
int main()
{
    cin >> T;
    while (T--)
    {
        cin >> n >> a >> b;
        cout << fun() << endl;
    }
}